Skip to content

Lesson 27 09#13

Open
LostPointer wants to merge 3 commits intoDafeCpp:mainfrom
LostPointer:lesson_27_09
Open

Lesson 27 09#13
LostPointer wants to merge 3 commits intoDafeCpp:mainfrom
LostPointer:lesson_27_09

Conversation

@LostPointer
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 15 out of 16. Check the log or trigger a new build to see more.

@@ -0,0 +1,3 @@
#pragma once

void Bar() {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'Bar' defined in a header file; function definitions in header files can lead to ODR violations [misc-definitions-in-headers]

void Bar() {}
     ^
Additional context

sandbox/template/src/foo.hpp:2: make as 'inline'

void Bar() {}
     ^

@@ -1,3 +1,26 @@
#include <bits/atomic_wait.h>
#include <iostream>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header atomic_wait.h is not used directly [misc-include-cleaner]

Suggested change
#include <iostream>
#include <iostream>


std::cout << sum << '\n';

utils::IntArray adda;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: call to deleted constructor of 'utils::IntArray' [clang-diagnostic-error]

  utils::IntArray adda;
                  ^
Additional context

sandbox/template/src/utils.hpp:16: 'IntArray' has been explicitly marked deleted here

  IntArray() = delete;
  ^

std::cout << sum << '\n';

utils::IntArray adda;
utils::IntArray b(1, 1);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'b' of type 'utils::IntArray' can be declared 'const' [misc-const-correctness]

Suggested change
utils::IntArray b(1, 1);
utils::IntArray const b(1, 1);

utils::IntArray adda;
utils::IntArray b(1, 1);

{ utils::IntArray a; }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: call to deleted constructor of 'utils::IntArray' [clang-diagnostic-error]

  { utils::IntArray a; }
                    ^
Additional context

sandbox/template/src/utils.hpp:16: 'IntArray' has been explicitly marked deleted here

  IntArray() = delete;
  ^

public:
Foo() { std::cout << "Foo()\n"; }
Foo(int) { std::cout << "Foo(int)\n"; }
Foo(const std::string &s) { std::cout << s << "(string)\n"; }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::string" is directly included [misc-include-cleaner]

sandbox/template/src/utils.hpp:3:

+ #include <string>

Comment thread task_01/src/sum.cpp
@@ -0,0 +1,3 @@
#include "sum.hpp"

int Sum(int first_number, int second_number, int third_number) { return 6; } No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'first_number' is unused [misc-unused-parameters]

Suggested change
int Sum(int first_number, int second_number, int third_number) { return 6; }
int Sum(int /*first_number*/, int second_number, int third_number) { return 6; }

Comment thread task_01/src/sum.cpp
@@ -0,0 +1,3 @@
#include "sum.hpp"

int Sum(int first_number, int second_number, int third_number) { return 6; } No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'second_number' is unused [misc-unused-parameters]

Suggested change
int Sum(int first_number, int second_number, int third_number) { return 6; }
int Sum(int first_number, int /*second_number*/, int third_number) { return 6; }

Comment thread task_01/src/sum.cpp
@@ -0,0 +1,3 @@
#include "sum.hpp"

int Sum(int first_number, int second_number, int third_number) { return 6; } No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: parameter 'third_number' is unused [misc-unused-parameters]

Suggested change
int Sum(int first_number, int second_number, int third_number) { return 6; }
int Sum(int first_number, int second_number, int /*third_number*/) { return 6; }

Comment thread task_05/src/main.cpp
@@ -0,0 +1,3 @@
#include <iostream>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header iostream is not used directly [misc-include-cleaner]

Suggested change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant